package id.co.rho.scoring.cid.shared.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class CriteriaObjectGroup implements Serializable {
	private static final long serialVersionUID = 6636129339141931785L;
	public static final String OR = "OR", AND = "AND";
	private CriteriaObjectGroup nextGroup;
	private List<CriteriaObject> criteriaObjectList;
	private String logicalExpression;
	public CriteriaObjectGroup() {
		super();
	}
	public CriteriaObjectGroup(CriteriaObject criteriaObject) {
		super();
		this.criteriaObjectList = new ArrayList<CriteriaObject>();
		criteriaObjectList.add(criteriaObject);
	}
	public CriteriaObjectGroup(List<CriteriaObject> criteriaObjectList) {
		super();
		this.criteriaObjectList = criteriaObjectList;
	}
	public CriteriaObjectGroup(CriteriaObjectGroup nextGroup,
			List<CriteriaObject> criteriaObjectList, String logicalExpression) {
		super();
		this.nextGroup = nextGroup;
		this.criteriaObjectList = criteriaObjectList;
		this.logicalExpression = logicalExpression;
	}
	public CriteriaObjectGroup getNextGroup() {
		return nextGroup;
	}
	public void setNextGroup(CriteriaObjectGroup nextGroup) {
		this.nextGroup = nextGroup;
	}
	public List<CriteriaObject> getCriteriaObjectList() {
		return criteriaObjectList;
	}
	public void setCriteriaObjectList(List<CriteriaObject> criteriaGroupList) {
		this.criteriaObjectList = criteriaGroupList;
	}
	public String getLogicalExpression() {
		return logicalExpression;
	}
	public void setLogicalExpression(String logicalExpression) {
		this.logicalExpression = logicalExpression;
	}
	public boolean isLast(){
		if(nextGroup==null)
			return true;
		else
			return false;
	}
}
